<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <script>

    const originArray = [1, 2, 3, 4, 5];
    const originObj = { a: 'a', b: 'b', c: [1, 2, 3], d: { dd: 'dd' } };

    const cloneArray = originArray;
    const cloneObj = originObj;

    console.log(cloneArray); // [1,2,3,4,5]
    console.log(originObj); // {a:'a',b:'b',c:Array[3],d:{dd:'dd'}}

    cloneArray.push(6);
    cloneObj.a = { aa: 'aa' };

    console.log(cloneArray); // [1,2,3,4,5,6]
    console.log(originArray); // [1,2,3,4,5,6]

    console.log(cloneObj); // {a:{aa:'aa'},b:'b',c:Array[3],d:{dd:'dd'}}
    console.log(originArray); // {a:{aa:'aa'},b:'b',c:Array[3],d:{dd:'dd'}}



  </script>
</body>

</html>